#!/usr/bin/python2.7
# -*- coding:UTF-8 -*-

import os
import sys

import function
import ipaReSign


def main():
    # 设置工作目录
    function.setWorkingDir()
    # 显示功能菜单
    while 1:
        print ' 功能菜单 '.center(50, '*')
        print '1.一键打包引导'
        print '2.ipa重签'
        print '3.支付回调'
        print '0.退出'
        print ' 功能菜单 '.center(50, '*')
        menuNumber = raw_input('输入功能编号:')

        if menuNumber == '0':
            function.cleanJunkFiles()
            break
        elif menuNumber == '1':
            function.create_packConfig()
            function.importSDK()
            function.setInfoPlist()
            function.setSDKConfig()
            function.importAssets()
            function.resign_ipa()
            function.get_payCallback()
        elif menuNumber == '2':
            ipaReSign.resign()
            break
        elif menuNumber == '3':
            function.get_payCallback('天宇游(1.0.12)', 'cy', '18221201')
        else:
            print '输入有误,请重新输入'


if __name__ == '__main__':
    main()
